package com.kaibes.imserver.view;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import com.kaibes.imserver.model.StartButtonListenerModel;

@SuppressWarnings("serial")
public class ServerPanelView extends JInternalFrame {

	public ServerPanelLog panel_start = null;
	public ServerPanelLog panel_data = null;
	public ServerPanelLog panel_login = null;
	public ServerPanelLog panel_main = null;
	public ServerPanelLog panel_sets = null;
	
	/**
	 * Launch the application.
	 */
	public ServerPanelView() {
		setTitle("\u51ef\u8d1d\u65afIM");
		init();
	}

	/**
	 * Create the frame.
	 */
	public ServerPanelView(String title) {
		setTitle(title);
		init();
	}
	
	private void init(){
		setResizable(true);
		setIconifiable(true);
		setMaximizable(true);
		setClosable(true);
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new BorderLayout(0, 0));
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		getContentPane().add(tabbedPane, BorderLayout.CENTER);
		
		{
			panel_start = new ServerPanelLog();
			tabbedPane.addTab("\u542f\u52a8\u65e5\u5fd7", null, panel_start, null);
			
			JPanel panel_bottom = new JPanel();
			panel_start.add(panel_bottom, BorderLayout.SOUTH);
			
			JButton startButton = new JButton("\u542f\u52a8\u670d\u52a1\u5668");
			startButton.addActionListener(new StartButtonListenerModel());
			panel_bottom.add(startButton);
			
		}
		
		{
			panel_data = new ServerPanelLog();
			tabbedPane.addTab("\u6570\u636e\u5e93\u65e5\u5fd7", null, panel_data, null);
		}
		
		{
			panel_login = new ServerPanelLog();
			tabbedPane.addTab("\u767b\u9646\u65e5\u5fd7", null, panel_login, null);
		}
		
		{
			panel_main = new ServerPanelLog();
			tabbedPane.addTab("\u7528\u6237\u65e5\u5fd7", null, panel_main, null);
		}
		
		{
			panel_sets = new ServerPanelLog();
			tabbedPane.addTab("\u7cfb\u7edf\u8bbe\u7f6e", null, panel_sets, null);
		}
		
		setVisible(true);
	}
	
}
